package com.sky.course.service;

import com.sky.course.entity.Course;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
* @Description:    根据已经有的CourseClientService接口新建一个实现了FallbackFactory接口的CourseClientServiceFallbackFactory
* @Author:         Joe
* @CreateDate:     2019/10/25 17:24
*/
//@FeignClient(value = "COURSE")
@FeignClient(value = "COURSE",fallbackFactory = CourseClientServiceFallbackFactory.class)
public interface CourseClientService {

    @RequestMapping(value = "/course/add",method = RequestMethod.POST)
    public boolean add(Course course);

    @RequestMapping(value = "/course/get/{cid}",method = RequestMethod.GET)
    public Course get(@PathVariable("cid") Integer cid);

    @RequestMapping(value = "/course/list",method = RequestMethod.GET)
    public List<Course> list();
}
